package com.zzc.controller;

import com.zzc.common.JsonResult;
import com.zzc.common.TableResult;
import com.zzc.pojo.ApiMapping;
import com.zzc.pojo.ApiMapping;
import com.zzc.service.ApiMappingService;
import com.zzc.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhouzhicheng
 * @version 1.0  2020/12/30
 */
@RequestMapping("/sys/api_mapping")
@RestController
public class ApiMappingController {
    @Autowired
    private ApiMappingService apiMappingService;
    @RequestMapping("/table")
    public TableResult getApiMappingList( String gatewayApiName,Integer state,Integer page, Integer limit){
        return apiMappingService.getApiMappingList(gatewayApiName,state,page,limit);
    }
    @RequestMapping("/del")
    public JsonResult deleteApiMappingsById(Integer[] ids){
        return apiMappingService.deleteApiMappingById(ids);
    }
    @RequestMapping("/add")
    public JsonResult addApiMapping(ApiMapping ApiMapping){
        return apiMappingService.insertApiMapping(ApiMapping);
    }
    @RequestMapping("/update")
    public JsonResult updateApiMapping(ApiMapping ApiMapping){
        return apiMappingService.updateByPrimaryKeySelective(ApiMapping);
    }

}
